goog.provide('bombernode');

goog.require('lime.Director');
goog.require('lime.Scene');
goog.require('lime.Layer');
goog.require('lime.GlossyButton');
goog.require('bombernode.Game');

bombernode.start = function(){

    this.HEIGHT = 600;
    this.WIDTH = 1200;
    this.BLOCKPOSSIBILITY = 30;
    this.XBLOCKS = 12;
    this.YBLOCKS = 6;

//    lime.scheduleManager.setDisplayRate(10);
//    lime.scheduleManager.setDisplayRate(1000 / 60);
	bombernode.director = new lime.Director(document.body, this.WIDTH, this.HEIGHT);
    var scene = new lime.Scene(),
        layer = new lime.Layer();

    var btn = new lime.GlossyButton('START').setSize(200, 80).setPosition(150, 100);
    goog.events.listen(btn, 'click', function() {
        bombernode.newgame();
    });

    layer.appendChild(btn);
    scene.appendChild(layer);

	// set current scene active
	bombernode.director.replaceScene(scene);
    bombernode.newgame();
}

bombernode.newgame = function() {
    var scene = new lime.Scene(),
    	layer = new lime.Layer();

    	scene.appendChild(layer);

    	var game = new bombernode.Game(this.WIDTH, this.HEIGHT);

    	layer.appendChild(game);
    	bombernode.director.replaceScene(scene);
}

//this is required for outside access after code is compiled in ADVANCED_COMPILATIONS mode
goog.exportSymbol('bombernode.start', bombernode.start);
